package com.zh.common.websocket;


import com.zh.common.utils.R;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller("ws/wsController")
public class WSTest {

	@ResponseBody
	@RequestMapping("/ws/send")
	public R sendMsg() {
		//建立连接
		ThmsWebSocketHandler swsh = ThmsWebSocketHandler.getSystemWebSocketHandler();
		//发送的消息
		ThmsWebSocketMessage twsm  = new ThmsWebSocketMessage("1", "1010111", "zszd", new Object());
		//发送
		swsh.sendMessageToUser( twsm);
		return R.ok();
	}
}
